///*
// * To change this template, choose Tools | Templates
// * and open the template in the editor.
// */
//package OLDSTUFF;
//
//import DataSetPackage.*;
//import java.util.ArrayList;
//import java.util.Collection;
//import java.util.HashMap;
//import java.util.HashSet;
//import java.util.Iterator;
//import java.util.List;
//import java.util.Map;
//import java.util.Set;
//
///**
// *
// * @author Martin Haulrich
// */
//public class DataSetProductMem { //implements DataSet {
////
////    Integer nextID;
////
////    /**
////     * @CONSIDER Change this to an array in order to save memory.
////     */
////    Map<Integer, int[]> data;
////
//////    // Dimension, classID, product-ids
//////    /**
//////     * Used for some stuff in getClassifications I think
//////     */
//////    List<Map<Integer, Set<Integer>>> lookup;
////
////    final int size;
////
////    public DataSetProductMem(int size) {
////        this.size = size;
////        nextID = 1;
////        data = new HashMap<Integer, int[]>();
//////        lookup = new ArrayList<Map<Integer, Set<Integer>>>(size);
//////        for (int i = 0; i < size; i++) {
//////            lookup.add(new HashMap<Integer, Set<Integer>>());
//////
//////        }
////
////    }
////
////    public int add(List<Integer> ids) {
////
////        Integer ID = nextID;
////        nextID++;
////        int[] idsArr = new int[size];
////        for (int i = 0; i < size; i++) {
////            idsArr[i] = ids.get(i);
//////            if (!lookup.get(i).containsKey(ids.get(i))) {
//////                lookup.get(i).put(ids.get(i), new HashSet<Integer>());
//////            }
//////            lookup.get(i).get(ids.get(i)).add(ID);
////        }
////        data.put(ID, idsArr);
////        return ID;
////    }
////
////    public Integer add(int[] ids) {
////
////
////        int ID = nextID;
////        nextID++;
////        int[] idsArr = new int[size];
////        for (int i = 0; i < size; i++) {
////            idsArr[i] = ids[i];
//////            if (!lookup.get(i).containsKey(ids[i])) {
//////                lookup.get(i).put(ids[i], new HashSet<Integer>());
//////            }
//////            lookup.get(i).get(ids[i]).add(ID);
////        }
////        data.put(ID, idsArr);
////        return ID;
////    }
////
////
////    /**
////     * @TODO This is hopelessly inefficient. Find a new way to arganize the data in this class in order to make this more efficient.
////     */
////    public Collection<Integer> getColumn(int columnNr, DataIDs dids) {
////
////        List<Integer> c = new ArrayList<Integer>();
////        for (Iterator<Integer> it = dids.getAll().iterator(); it.hasNext();) {
////            Integer id = it.next();
////            int[] row = data.get(id);
////            c.add(row[columnNr]);
////        }
////        return c;
////    }
////
////    public Collection<Integer> allIds() {
////        return data.keySet();
////    }
////
////    @Override
////    public void remove(Integer dataID) throws DataSetException {
////        data.remove(dataID);
////    }
////
////    @Override
////    public DataIDs getDataIDs() throws DataSetException {
////        return new DataIDs(data.keySet());
////    }
////
////    @Override
////    public Iterator<Integer> keyIterator() {
////        return new DataSetKeyIterator();
////    }
////
////    public int[] get(Integer id) {
////        return data.get(id);
////    }
////
////    @Override
////    public int size() {
////        return data.size();
////    }
////
////    /**
////     * Class for the keyIterator
////     */
////    class DataSetKeyIterator implements Iterator<Integer> {
////
////        /**
////         * Used because keys in map are returned as Set
////         */
////        Iterator<Integer> setIterator;
////
////        /**
////         * Set of keys in map
////         */
////        Set<Integer> keys;
////
////        /**
////         * Constructor
////         */
////        public DataSetKeyIterator() {
////
////            keys = data.keySet();
////            setIterator = keys.iterator();
////        }
////
////        @Override
////        public void remove() {
////            // This will work - I think
////            setIterator.remove();
////        }
////
////        @Override
////        public Integer next() {
////            Integer elem = setIterator.next();
////            return elem;
////        }
////
////        @Override
////        public boolean hasNext() {
////            return setIterator.hasNext();
////
////        }
////    }
//}
